<template>
	<view class="wrap">
		<u-form class="form" :model="model" ref="uForm" label-position="left">
			<u-form-item label="督办字号" label-width="180">
				<u-input  v-model="model.messageNumber" disabled type="text" ></u-input>
			</u-form-item>
			<u-form-item label="任务标题" label-width="180">
				<u-input  v-model="model.taskTitle" disabled type="textarea" ></u-input>
			</u-form-item>
			<u-form-item label="任务类型" prop="taskTypeCode" label-width="180">
				<u-input  v-model="model.taskTypeName" disabled type="text" ></u-input>			</u-form-item>
			<u-form-item label="任务内容" label-width="180" label-position="top">
				<u-input type="textarea" disabled v-model="model.taskContent"  maxlength="500" />
			</u-form-item>
			<u-form-item label="牵头责任单位" label-width="180" label-position="top">
				<u-input type="textarea" disabled v-model="model.leaderOrgName" />
			</u-form-item>
			<!-- 附件 -->
				<view class="lh-mt-36">
					<LhFilelist v-if="model.taskId" :bizKey="model.taskId" bizType="dcSupTaskInfo_file" />
				</view>
		</u-form>
		<view class="form-footer">
			<u-button class="btn" type="primary" @click="submit" v-if="model.taskStatus==1">接收</u-button>
		</view>
	</view>
</template>
<script>
/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
import LhFilelist from '@/components/lh-filelist/lh-filelist.vue';
export default {
	components: {
		LhFilelist
	},
	data() {
		return {
			model: {
				id: '',
				messageNumber: '',
				taskTitle: '',
				taskContent: '',
				taskTypeCode: '',
				leaderOrgName:''
			},
		};
	},
	onLoad(params){
		// if(params.transferFlag==1){
		// 	params.transferFlag=1
		// }else{
		// 	params.transferFlag=''
		// }
		this.$u.api.taskReceive.getActionById(params).then(res => {
			Object.assign(this.model, res.data);
		});
	},
	onReady() {
		
	},
	methods: {
		submit() {
			this.model.taskStatus=2
			this.$u.api.taskReceive.receive(this.model).then(res => {
				uni.showModal({
					title: '提示',
					content: res.message,
					showCancel: false,
					success: function () {
						if (res.result == 'true') {
							uni.setStorageSync('refreshList', true);
							uni.navigateBack();
						}
					}
				});
			});
		},
		cancel() {
			uni.navigateBack();
		}
	}
};
</script>
<style lang="scss">

</style>
